
package com.gov.ec.rsv.convertidores;


import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.convert.Converter;

/**
 * 
 *  Esta clase permite convertidor una cadena a letras mayúsculas
 *	@author martosfre
 *	Mar 29, 2011
 *  see www.matoosfe.com
 */
public class ConvertidorMayusculas implements Converter{

	
	
	/* (non-Javadoc)
	 * @see javax.faces.convert.Converter#getAsObject(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.String)
	 */
	@Override
	public Object getAsObject(FacesContext arg0, UIComponent arg1, String obj) {
		String cadenaUper = null;
		if(obj != null){
			cadenaUper = obj.toUpperCase();
		}
		return cadenaUper;
	}

	/* (non-Javadoc)
	 * @see javax.faces.convert.Converter#getAsString(javax.faces.context.FacesContext, javax.faces.component.UIComponent, java.lang.Object)
	 */
	@Override
	public String getAsString(FacesContext arg0, UIComponent arg1, Object obj) {
		String cadenaUper = null;
		if(obj != null){
			cadenaUper = obj.toString().toUpperCase();
		}
		return cadenaUper;
	}

}
